﻿using DigitalHealth.PACS.Model;
using DigitalHealth.PACS.UserService.Repositories;
using DigitalHealth.PACS.UserService.Repositories.Imp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DigitalHealth.PACS.UserService.Services.Imp
{
    internal class PACSUserServerImp : IPACSUserServer
    {
        public IPacsUserRepository chatUserRepository { get; set; }

        public PACSUserServerImp(IPacsUserRepository chatUserRepository)
        {
            this.chatUserRepository = chatUserRepository;
        }

        public bool UserExists(PACSUser user)
        {
            return chatUserRepository.UserExists(user.Id.ToString());
        }

        public void Create(PACSUser user)
        {
            chatUserRepository.Create(user);
        }

        public void Delete(PACSUser user)
        {
            chatUserRepository.Delete(user);
        }

        public IEnumerable<PACSUser> GetUsers()
        {
            return chatUserRepository.GetUsers();
        }

        public PACSUser GetUsersById(string id)
        {
            return chatUserRepository.GetUserById(id);
        }


        public void Update(PACSUser user)
        {
            chatUserRepository.Update(user);
        }
    }
}
